
** Load the dataset 

use "(your directory)\Dataset JPP.dta", clear


** Figure 1 Mean Response 

cibar psm_answer, over1(q7_grp) ylabel(3.4 (.2) 4.2))


** Table 2 Balance Test

oneway agegroup q7_grp, tabulate
oneway educ q7_grp, tabulate
oneway female q7_grp, tabulate
oneway duty q7_grp, tabulate
oneway rank q7_grp, tabulate
oneway recruitpath q7_grp, tabulate
oneway private q7_grp, tabulate


** Table 3. OLS Regression Analysis: Diverse Policy Environments and Civil Servants' PSM

reg psm_answer i.treatment_psm female agegroup educ duty rank recruitpath private i.org, cluster(org)


** Figure 2. Average Treatment Effects on Civil Servants' PSM

reg psm_answer treatment1 i.org, vce(robust) 
margins, dydx(treatment1) post
estimates store treatment1_1

reg psm_answer treatment2 i.org, vce(robust) 
margins, dydx(treatment2) post
estimates store treatment2_1

reg psm_answer treatment3 i.org, vce(robust) 
margins, dydx(treatment3) post
estimates store treatment3_1

reg psm_answer treatment4 i.org, vce(robust) 
margins, dydx(treatment4) post
estimates store treatment4_1

coefplot (treatment1_1, label(T1)) (treatment2_1, label(T2)) (treatment3_1, label(T3)) (treatment4_1, label(T4)), vertical subtitle() ytitle(Average Treatment Effects) yline(0) ylabel(-.4(.2).4) 


***** Appendix

** Table A1. Correlation Matrix 

pwcorr psm_answer treatment1 treatment2 treatment3 treatment4 female agegroup educ duty rank recruitpath private


** Table A2. Three dimensions of PSM 

reg psm_answer_commit i.treatment_psm female agegroup educ duty rank recruitpath private i.org, cluster(org)

reg psm_answer_attraction i.treatment_psm female agegroup educ duty rank recruitpath private i.org, cluster(org)

reg psm_answer_compassion i.treatment_psm female agegroup educ duty rank recruitpath private i.org, cluster(org)


** Table A3. Causal Mediation Analysis 

* self efficacy q4_1_n3

quietly reg q7_1_answer treatment4 i.org, vce(robust) 
quietly reg psm_answer treatment4 i.org, vce(robust) 


** For Mediation Analysis 

medeff (regress q7_1_answer treatment1) (regress psm_answer q7_1_answer treatment1), mediate(q7_1_answer) treat(treatment1) sims(1000) 

medeff (regress q7_1_answer treatment2) (regress psm_answer q7_1_answer treatment2), mediate(q7_1_answer) treat(treatment2) sims(1000)

medeff (regress q7_1_answer treatment3) (regress psm_answer q7_1_answer treatment3), mediate(q7_1_answer) treat(treatment3) sims(1000) 

medeff (regress q7_1_answer treatment4) (regress psm_answer q7_1_answer treatment4), mediate(q7_1_answer) treat(treatment4) sims(1000) 



** Table A4. Additional T-test 

* within *

ttest psm_t1 = psm_t2, unp
ttest psm_t3 = psm_t4, unp


* between *

ttest psm_t1 = psm_t3, unp
ttest psm_t1 = psm_t4, unp

ttest psm_t2 = psm_t3, unp
ttest psm_t2 = psm_t4, unp
